<?php
namespace Home\Controller;
use Think\Controller;
class UserController extends PublicController {
    public function __construct(){
        parent::__construct();
    }

    public function info(){
    	
        $id = I('path.2');
        $user = M('user as a')
            ->join('left join city as b on a.city_id = b.id ')
            ->field('a.*, b.name as city_name')
            ->where('a.uuid= "'.$id.'"')
            ->find();
        $info = M('content as a')
            ->join('left join user as b on a.user_id = b.id left join city as c on b.city_id = c.id left join type as d on a.type_id = d.id')
            ->field('a.*, b.uuid , b.nick_name , b.head_ico , b.exp, c.name as city_name , b.major ,b.school_end_time , d.name as type_name')
            ->where('a.status = 1 and b.uuid= "'.$id.'"' )
            ->select();    
        foreach ($info as $key => $value) {

            $info[$key]['imgs'] = json_decode($info[$key]['imgs'],true);
            $info[$key]['videos'] = json_decode($info[$key]['videos'],true);
            $info[$key]['files'] = json_decode($info[$key]['files'],true);
            $info[$key]['create_time']=date("Y-m-d",$info[$key]['create_time']);

        }
   

        $this->user = $user;
        $this->info = $info;


        $this->display();
    }

    

}